/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { RListUserVo } from '../models/RListUserVo';
import type { RPageUserApplyVo } from '../models/RPageUserApplyVo';
import type { RString } from '../models/RString';
import type { UserApplyCriteria } from '../models/UserApplyCriteria';
import type { UserApplyDto } from '../models/UserApplyDto';
import type { UserFriendDto } from '../models/UserFriendDto';

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';

export class FriendService {

    /**
     * 查询用户的好友信息
     * @returns RListUserVo OK
     * @throws ApiError
     */
    public static queryUserFriend(): CancelablePromise<RListUserVo> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/1.0/friend',
        });
    }

    /**
     * 拉黑好友
     * @param requestBody
     * @returns RString OK
     * @throws ApiError
     */
    public static blackFriend(
        requestBody: UserFriendDto,
    ): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'PUT',
            url: '/api/1.0/friend',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * 查询用户的申请列表信息信息
     * @param requestBody
     * @returns RPageUserApplyVo OK
     * @throws ApiError
     */
    public static queryUserApplyInfo(
        requestBody: UserApplyCriteria,
    ): CancelablePromise<RPageUserApplyVo> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/1.0/friend/queryUserApplyInfo',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * 拒绝好友申请
     * @param id
     * @returns RString OK
     * @throws ApiError
     */
    public static deleteUserApply(
        id: number,
    ): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/1.0/friend/deleteUserApply',
            query: {
                'id': id,
            },
        });
    }

    /**
     * 申请好友信息
     * @param requestBody
     * @returns RString OK
     * @throws ApiError
     */
    public static addUserApply(
        requestBody: UserApplyDto,
    ): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/1.0/friend/addUserApply',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * 通过好友申请
     * @param id
     * @returns RString OK
     * @throws ApiError
     */
    public static accessApply(
        id: number,
    ): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/1.0/friend/accessUserApply',
            query: {
                'id': id,
            },
        });
    }

}
